package com.prs.crm.action.oa.schedule;

import org.apache.struts2.convention.annotation.Action;
import org.courser.struts.BaseAction;
import org.courser.ui.PaginationSupport;
import org.hibernate.criterion.DetachedCriteria;

import com.prs.crm.domain.oa.schedule.IntervalSchedule;
import com.prs.crm.service.oa.schedule.IntervalScheduleService;

public class InterValScheduleAction extends BaseAction{

	private static final long serialVersionUID = 1L;
	private IntervalSchedule intervalSchedule;
	private IntervalScheduleService intervalScheduleService;
	
	private Integer[] ids;
	
	private PaginationSupport pagination;

	public IntervalSchedule getIntervalSchedule() {
		return intervalSchedule;
	}

	public void setIntervalSchedule(IntervalSchedule intervalSchedule) {
		this.intervalSchedule = intervalSchedule;
	}

	public IntervalScheduleService getIntervalScheduleService() {
		return intervalScheduleService;
	}

	public void setIntervalScheduleService(
			IntervalScheduleService intervalScheduleService) {
		this.intervalScheduleService = intervalScheduleService;
	}

	public Integer[] getIds() {
		return ids;
	}

	public void setIds(Integer[] ids) {
		this.ids = ids;
	}

	public PaginationSupport getPagination() {
		return pagination;
	}

	public void setPagination(PaginationSupport pagination) {
		this.pagination = pagination;
	}
	
	@Action("listIntervalSchedule")
	public String listIntervalSchedule(){
		DetachedCriteria criteria=this.getPaginationHelper().createQuery(IntervalSchedule.class);
		pagination=this.getPaginationHelper().prepare(pagination);
		this.setPagination(this.getIntervalScheduleService().listByPage(criteria, pagination));
		return SUCCESS;
	}
}
